﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Veteran_cms.Models.HomeAdminListViewModel>" %>
<%@ Import Namespace="THS.HtmlHelpers" %>
<div class="widget">
    <div class="title">
        <span class="titleIcon">
            <input type="checkbox" id="titleCheck" name="titleCheck" /></span><h6>
                Danh sách tin tức - thời sự</h6>
        <%--  <div style="float: right">
            <a href="<%=Url.Action("Create","ManageComment") %>" title="" class="button greyishB"
                style="margin: 5px;">
                <img src="../../images/adminSite/icons/light/create.png" alt="" class="icon" /><span>THÊM
                    MỚI</span></a></div>--%>
    </div>
    <table cellpadding="0" cellspacing="0" width="100%" class="sTable withCheck mTable"
        id="checkAll">
        <% var ctx = new Veteran_cms.Models.Veterandb(); %>
        <thead>
            <tr>
                <td>
                    <img src="../../images/adminSite/icons/tableArrows.png" alt="" />
                </td>
                <td style="width: 15%" class="sortCol">
                    <div>
                        Tiêu đề<span></span></div>
                </td>
                <td style="width: 25%" class="sortCol">
                    <div>
                        Nội dung<span></span></div>
                </td>
                <td style="width: 15%" class="sortCol">
                    <div>
                        Trạng thái<span></span></div>
                </td>
                <td style="width: 15%" class="sortCol">
                    <div>
                        Ngày hiển thị<span></span></div>
                </td>
                <td style="width: 15%" class="sortCol">
                    <div>
                        Loại comment<span></span></div>
                </td>
                <td>
                    Chức năng
                </td>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td colspan="6">
                    <div class="tPagination">
                        <%if (Model != null)
                          { %>
                        <%=Ajax.Pager(Model.CommentPageInfo.CurrentPage, Model.CommentPageInfo.TotalItems, "UCCommentList", 0, Model.CommentPageInfo.ItemsPerPage, "Paging")%>
                        <%} %>
                    </div>
                </td>
            </tr>
        </tfoot>
        <tbody>
            <%if (Model.Comments != null)
              {
                  foreach (var item in Model.Comments)
                  {%>
            <tr>
                <td>
                    <input type="checkbox" id="titleCheck2" name="checkRow" />
                </td>
                <td>
                    <a href="<%=Url.Action("Details", "ManageComment", new {id = item.comment_id}) %>"
                        title="">
                        <%=item.title%></a>
                </td>
                <td>
                    <%=item.content%>
                </td>
                <td>
                    <%= (ViewData["CommentStatus"] as SelectList).FirstOrDefault(x=> decimal.Parse( x.Value) ==  item.is_active).Text %>
                </td>
                <td>
                    <i>
                        <%=item.activate_date%></i>
                </td>
                <td>
                    <%=item.comment_type%>
                </td>
                <td class="actBtns">
                    <a href="<%=Url.Action("Details", "ManageComment", new {id = item.comment_id}) %>"
                        title="Cập nhật" class="tipS">
                        <img src="../../images/adminSite/icons/dark/pencil.png" alt="" /></a> <a href="<%=Url.Action("Delete", "ManageComment", new {id = item.comment_id}) %>"
                            title="Xóa" class="tipS">
                            <img src="../../images/adminSite/icons/uploader/deleteFile.png" alt="" onclick="return ConfirmDelete()" /></a>
                </td>
            </tr>
            <%}
              }%>
        </tbody>
    </table>
</div>
